<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
<div style="clear:both;"></div>
<div class="description_pois">
	<?php if (count($this->pois)) { ?>
		<ul class="pois">
		<?php 
		foreach ($this->pois as $poi) {
			$poi_xml    = new SimpleXMLElement($poi->asXML());
			$poi_images = $poi_xml->xpath('/poi/media/pictures/file');
			$poi_links  = $poi_xml->xpath('/poi/media/links/link');
			?>
			<li>
				<img src="<?php echo $this->api_url_image_pois.$poi->symbole; ?>" alt="<?php echo $poi->name; ?>" />
				<?php echo $poi->name; ?>
				&nbsp;(<?php echo $poi->position->lng; ?>/<?php echo $poi->position->lat; ?>)
				<p>
					<?php echo $poi->description; ?>
				</p>
				<?php if (count($poi_links)) { ?>
					<?php echo JText::_('COM_GEOTRAILS_LINKS'); ?>
					<ul>
					<?php
					foreach ($poi_links as $link) {
						?>
						<li>
						<a href="<?php echo $link; ?>" target="_blank"><?php echo $link; ?></a>
						</li>
						<?php
					}
					?>
					</ul>
				<?php } ?>
				<?php if (count($poi_images)) { ?>
					<?php
					foreach ($poi_images as $image) {
						?>
						<a href="<?php echo $this->api_url_image.$image; ?>" rel="lightbox[poi]" title="<?php echo $poi->name; ?>">
							<img src="<?php echo $this->api_url_image.$image; ?>" alt="<?php echo $poi->name; ?>" class="miniature">
						</a>
						<?php
					}
					?>
				<?php } ?>
			</li>
		<?php } ?>
		</ul>
	<?php } else { ?>
		<p><?php echo JText::_('COM_GEOTRAILS_NO_POIS'); ?></p>
	<?php } ?>
</div>